package com.youdoneed.common.feign;

import com.youdoneed.base.application.ResultMessage;
import com.youdoneed.common.model.FileInfo;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 失败时的方法实现。
 */
@Component
public class FileFallback implements FileFeignClient {

    @Override
    public ResultMessage<FileInfo> getFileInfo(String fileId) {
        return new ResultMessage<FileInfo>().toFailure("获取文件信息失败！");
    }

    @Override
    public ResultMessage<List<FileInfo>> getFileInfos(String[] fileIds) {
        return new ResultMessage<List<FileInfo>>().toFailure("获取多个文件信息失败！");
    }

    @Override
    public ResultMessage<FileInfo> deleteFile(String fileId) {
        return new ResultMessage<FileInfo>().toFailure("根据ID删除文件失败！");
    }

    @Override
    public ResultMessage<FileInfo> deleteByUrl(String url) {
        return new ResultMessage<FileInfo>().toFailure("根据URL删除文件失败！");
    }

}